package com.ty.day2;

import java.nio.file.LinkOption;
import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/23 16:03
 */
public class Demo01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入星期几的第一个字母（大写）：");
        char firstLetter = scanner.next().charAt(0);

        switch (Character.toUpperCase(firstLetter)) {
            case 'M':
                System.out.println("Monday（星期一）");
                break;
            case 'T':
                System.out.print("请输入星期几的第二个字母（大写）：");
                char secondLetter = scanner.next().charAt(0);
                switch (Character.toUpperCase(secondLetter)) {
                    case 'U':
                        System.out.println("Tuesday（星期二）");
                        break;
                    case 'H':
                        System.out.println("Thursday（星期四）");
                        break;
                    default:
                        System.out.println("输入无效");
                        break;
                }
                break;
            case 'W':
                System.out.println("Wednesday（星期三）");
                break;
            case 'F':
                System.out.println("Friday（星期五）");
                break;
            case 'S':
                System.out.print("请输入星期几的第二个字母（大写）：");
                char secondLetterS = scanner.next().charAt(0);
                switch (Character.toUpperCase(secondLetterS)) {
                    case 'U':
                        System.out.println("Sunday（星期日）");
                        break;
                    case 'A':
                        System.out.println("Saturday（星期六）");
                        break;
                    default:
                        System.out.println("输入无效");
                        break;
                }
                break;
            default:
                System.out.println("输入无效");
                break;
        }
    }
    public static void main11(String[] args) {
        long begin,end;
        StringBuffer sb=new StringBuffer();
        begin=System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            sb.append("a");
        }
        end = System.currentTimeMillis();
        System.out.println(end-begin);
        StringBuilder sb1=new StringBuilder();
        begin=System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            sb1.append("a");
        }
        end = System.currentTimeMillis();
        System.out.println(end-begin);
        String s="";
        begin=System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            s+="a";
        }
        end = System.currentTimeMillis();
        System.out.println(end-begin);

    }
}
